The approaches described in this section could be pursued but are not necessarily approaches that have previously been conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.
In computer systems, data stored in Random Access Memory (RAM), a hard disk drive (HDD), or some other data storage device is usually organized as objects having references referring to these objects. An object may have many references that point to it, and conversely, the object itself may include references that point to other objects.
In order to effectively utilize the resources of a computer memory and hard disk storage devices, it is important to know whether a given object has any references referring to it. If there are no references referring to the object, then it means that the object is no longer used and, therefore, can be removed from the object database and the space in a computer memory or a hard disk storage used by the object can be labeled as unoccupied and used by new data objects.
Some computer systems can use simple reference counting techniques to track how many references are referring to a given object. Each time a new reference is added to an object, the reference counter associated with the object is incremented by one, and correspondingly, each time a reference referring to the given object is removed, the reference counter is decremented by one. If a stored value for the reference counter of an object ever reaches zero, the object can be freed, and if the object is referencing other objects, their reference counters can be decremented in turn. Thus, deletion of one object can cause a recursive cascade of freed objects and widespread decrementing of reference counts. Accordingly, an incorrect count of references can result in massive data loss due to reference counters of objects becoming zero and deletion of the objects.
Several situations can lead to incorrect reference counts (for example, a counter is not properly incremented but subsequently decremented, a counter of the same reference is decremented more than once, a counter of a wrong objected is decremented, or the reference counter is corrupted). These errors can be caused by both data corruptions and software bugs, which are always a possibility. Therefore, additional measures preventing accidental deletion of an object due to an incorrect reference counter should be undertaken.